<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form TbActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(

	'id'=>'user-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<?php echo  $form->textFieldControlGroup($model,'username',array('span'=>5,'maxlength'=>128)); ?>
	
	<?php echo  $form->textFieldControlGroup($model,'fullname',array('span'=>5,'maxlength'=>256)); ?>
	
	<?php if ($model->id==null){ ?>
	 <?php echo $form->passwordFieldControlGroup($model,'password',array('span'=>5,'maxlength'=>128)); ?>
	
	<?php echo $form->passwordFieldControlGroup($model,'password_repeat',array('span'=>5,'maxlength'=>128)); ?>
	
<?php } ?>

		
	<?php echo $form->textFieldControlGroup($model,'email',array('span'=>5,'maxlength'=>128)); ?>

	<?php echo $form->textFieldControlGroup($model,'mobile',array('span'=>5,'maxlength'=>20)); ?>
	
    
	<?php if (Yii::app()->user->role=='admin'){ ?>	
    
    <?php echo $form->dropDownListControlGroup($model, 'role_id',
        CHtml::listData(Role::model()->findAll(), 'id', 'roleString'), array()); ?>
        
    <?php echo $form->dropDownListControlGroup($model, 'isactive',array(1=>Yii::t('default','status_1'),0=>Yii::t('default','status_0')), array()); ?>    
       
    
<?php }?> 


    

	<div class="row buttons">
        <?php echo TbHtml::submitButton($model->isNewRecord ? Yii::t('default','Save'):Yii::t('default','Update'),array(
		    'color'=>TbHtml::BUTTON_COLOR_PRIMARY,
		    'size'=>TbHtml::BUTTON_SIZE_DEFAULT,
		)); ?>
	</div>
	

<?php $this->endWidget(); ?>

</div><!-- form -->